package com.yonyou.iuap.jxzy.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.yonyou.iuap.base.web.BaseController;
import com.yonyou.iuap.jxzy.service.ReceiveUnattendedService;
import com.yonyou.iuap.mvc.type.JsonResponse;

/**
 * 接收无人值守请求控制器
 * @author WXF
 *
 */
@Controller
@RequestMapping(value="/unattended")
public class ReceiveUnattendedController extends BaseController {
	
	@Autowired
	private ReceiveUnattendedService receiveUnattendedService;
	
	/**
	 * 获取硬件适配器车辆识别信息
	 * @param request
	 * @param response
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/identifiedCarno")
	public JsonResponse identifiedCarno(HttpServletRequest request,HttpServletResponse response){
		 Map<String, Object> map = new HashMap<String, Object>();
		 String json = request.getParameter("argumentsInfo");
		 Map<String,String> argsMap = (Map<String, String>) JSONObject.parseObject(json, Map.class).get("argsMap");
		 String res = this.receiveUnattendedService.identifiedCarno(argsMap);
	     map.put("data", res);
	     return this.buildMapSuccess(map);
	}
}
